package com.jt.www.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jt.www.domain.enums.common.PushStatusEnum;
import com.jt.www.domain.enums.common.YgSettStatusEnum;
import com.jt.www.domain.enums.wxb.PerformanceSendStatusEnum;
import com.jt.www.domain.po.CommissionPush;
import com.jt.www.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 业绩管理导出
 * Created by lq on 2020/11/19.
 */
public class CommissionPushDownDTO {

    @ApiModelProperty(value = "产品编码")
    private String productCode;

    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "产品佣金占比")
    private BigDecimal comProdAcc;

    @ApiModelProperty(value = "是否含税 1：含税 2：不含税")
    private Byte isIncludeTax;

    @ApiModelProperty(value = "角色编码")
    private String roleCode;

    @ApiModelProperty(value = "角色名称")
    private String roleName;

    @ApiModelProperty(value = "营销人员佣金占比")
    private BigDecimal brokerAcc;

    @ApiModelProperty(value = "产品佣金占比")
    private BigDecimal departmentAcc;

    @ApiModelProperty(value = "机构管理佣金占比")
    private BigDecimal branchOfficeAcc;

    @ApiModelProperty(value = "总公司利润占比")
    private BigDecimal headOfficeAcc;

    @ApiModelProperty(value = "营销人员代码")
    private String marketerNo;

    @ApiModelProperty(value = "保单号")
    private String policyNo;

    @ApiModelProperty(value = "批单号")
    private String endorsementNo;

    @ApiModelProperty(value = "保费")
    private BigDecimal premium;

    @ApiModelProperty(value = "出单时间")
    private String issureDate;

    @ApiModelProperty(value = "投保人名称")
    private String holderName;

    @ApiModelProperty(value = "被保险人名称")
    private String insuredName;

    @ApiModelProperty(value = "营销员专属渠道编码")
    private String channelCode;

    @ApiModelProperty(value = "营销员专属渠道名称")
    private String channelName;

    @ApiModelProperty(value = "营销人员姓名")
    private String marketerName;

    @ApiModelProperty(value = "营销人员手机")
    private String marketerPhone;

    @ApiModelProperty(value = "营销员分支机构编码")
    private String branchCode;

    @ApiModelProperty(value = "营销员分支机构名称")
    private String branchName;

    @ApiModelProperty(value = "创始人团队ID")
    private Long teamId;

    @ApiModelProperty(value = "创始人团队名称")
    private String teamName;

    @ApiModelProperty(value = "创始人ID")
    private Long teamFounderId;

    @ApiModelProperty(value = "创始人员工编号")
    private String founderNo;

    @ApiModelProperty(value = "创始人名称")
    private String founderName;

    @ApiModelProperty(value = "营销人员佣金")
    private BigDecimal brokerFyc;

    @ApiModelProperty(value = "部门管理费")
    private BigDecimal departmentFee;

    @ApiModelProperty(value = "分公司管理费")
    private BigDecimal branchOfficeFee;

    @ApiModelProperty(value = "总部利润")
    private BigDecimal headOfficeFee;

    @ApiModelProperty(value = "特殊类型标识")
    private Byte specialType;

    @ApiModelProperty(value = "指定营销人员工号 ")
    private String fixedAgentCode;

    @ApiModelProperty(value = "指定营销人员工号 ")
    private String fixedAgentName;

    @ApiModelProperty(value = "指定佣金 ")
    private BigDecimal fixedMoney;

    @ApiModelProperty(value = "增员渠道编码")
    private String addChannelCode;

    @ApiModelProperty(value = "增员渠道名称")
    private String addChannelName;

    @ApiModelProperty("推荐人编号")
    private String referrerCode;

    @ApiModelProperty("推荐人名称")
    private String referrerName;

    @ApiModelProperty(value = "推荐人手机号")
    private String referrerPhone;

    @ApiModelProperty(value = "推荐人分支机构编码")
    private String referrerBranchCode;

    @ApiModelProperty(value = "推荐人分支机构名称")
    private String referrerBranchName;

    @ApiModelProperty(value = "标记发放状态 1-已发放，2-未发放")
    private String sendStatus;

    @ApiModelProperty(value = "推送状态   1-未推送，2-推送成功，3-推送失败")
    private String pushStatus;

    @ApiModelProperty(value = "业管结算状态 1-已经结算; 0-未结算")
    private String ygSettStatus;

    @ApiModelProperty(value = "推送次数")
    private Integer times;

    @ApiModelProperty(value = "出错原因")
    private String errorMsg;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "是否删除：1-是；0-否")
    private Byte isDeleted;

    public CommissionPushDownDTO(CommissionPush commissionPush) {
        this.productName = commissionPush.getProductName();
        this.policyNo = StringUtils.isBlank(commissionPush.getPolicyNo()) ? commissionPush.getEndorsementNo() : commissionPush.getPolicyNo();
        this.holderName = commissionPush.getHolderName();
        this.insuredName = commissionPush.getInsuredName();
        this.issureDate = DateUtils.conver(commissionPush.getIssureDate(), DateUtils.DATE_TIME_FORMAT_YYYY_MM_DD_HH_MI_SS);
        this.premium = commissionPush.getPremium();
        this.marketerName = commissionPush.getMarketerName();
        this.marketerPhone = commissionPush.getMarketerPhone();
        this.channelName = commissionPush.getChannelName();
        this.addChannelName = commissionPush.getAddChannelName();
        this.branchName = commissionPush.getBranchName();
        this.fixedAgentName = commissionPush.getFixedAgentName();
        this.roleName = commissionPush.getRoleName();
        this.teamName = commissionPush.getTeamName();
        this.brokerFyc = commissionPush.getBrokerFyc();
        this.departmentFee = commissionPush.getDepartmentFee();
        this.branchOfficeFee = commissionPush.getBranchOfficeFee();
        this.headOfficeFee = commissionPush.getHeadOfficeFee();
        this.departmentAcc = commissionPush.getDepartmentAcc();
        this.branchOfficeAcc = commissionPush.getBranchOfficeAcc();
        this.headOfficeFee = commissionPush.getHeadOfficeFee();
        this.referrerCode = commissionPush.getReferrerCode();
        this.referrerName = commissionPush.getReferrerName();
        this.referrerPhone = commissionPush.getReferrerPhone();
        this.referrerBranchCode = commissionPush.getReferrerBranchCode();
        this.referrerBranchName = commissionPush.getReferrerBranchName();
        this.sendStatus = PerformanceSendStatusEnum.getDestByStatus(commissionPush.getSendStatus());
        this.pushStatus = PushStatusEnum.getDescByCode(commissionPush.getPushStatus());
        this.ygSettStatus = YgSettStatusEnum.getDescByCode(commissionPush.getYgSettStatus());
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public BigDecimal getComProdAcc() {
        return comProdAcc;
    }

    public void setComProdAcc(BigDecimal comProdAcc) {
        this.comProdAcc = comProdAcc;
    }

    public Byte getIsIncludeTax() {
        return isIncludeTax;
    }

    public void setIsIncludeTax(Byte isIncludeTax) {
        this.isIncludeTax = isIncludeTax;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public BigDecimal getBrokerAcc() {
        return brokerAcc;
    }

    public void setBrokerAcc(BigDecimal brokerAcc) {
        this.brokerAcc = brokerAcc;
    }

    public BigDecimal getDepartmentAcc() {
        return departmentAcc;
    }

    public void setDepartmentAcc(BigDecimal departmentAcc) {
        this.departmentAcc = departmentAcc;
    }

    public BigDecimal getBranchOfficeAcc() {
        return branchOfficeAcc;
    }

    public void setBranchOfficeAcc(BigDecimal branchOfficeAcc) {
        this.branchOfficeAcc = branchOfficeAcc;
    }

    public BigDecimal getHeadOfficeAcc() {
        return headOfficeAcc;
    }

    public void setHeadOfficeAcc(BigDecimal headOfficeAcc) {
        this.headOfficeAcc = headOfficeAcc;
    }

    public String getMarketerNo() {
        return marketerNo;
    }

    public void setMarketerNo(String marketerNo) {
        this.marketerNo = marketerNo;
    }

    public String getPolicyNo() {
        return policyNo;
    }

    public void setPolicyNo(String policyNo) {
        this.policyNo = policyNo;
    }

    public String getEndorsementNo() {
        return endorsementNo;
    }

    public void setEndorsementNo(String endorsementNo) {
        this.endorsementNo = endorsementNo;
    }

    public BigDecimal getPremium() {
        return premium;
    }

    public void setPremium(BigDecimal premium) {
        this.premium = premium;
    }

    public String getIssureDate() {
        return issureDate;
    }

    public void setIssureDate(String issureDate) {
        this.issureDate = issureDate;
    }

    public String getHolderName() {
        return holderName;
    }

    public void setHolderName(String holderName) {
        this.holderName = holderName;
    }

    public String getInsuredName() {
        return insuredName;
    }

    public void setInsuredName(String insuredName) {
        this.insuredName = insuredName;
    }

    public String getChannelCode() {
        return channelCode;
    }

    public void setChannelCode(String channelCode) {
        this.channelCode = channelCode;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getMarketerName() {
        return marketerName;
    }

    public void setMarketerName(String marketerName) {
        this.marketerName = marketerName;
    }

    public String getMarketerPhone() {
        return marketerPhone;
    }

    public void setMarketerPhone(String marketerPhone) {
        this.marketerPhone = marketerPhone;
    }

    public String getBranchCode() {
        return branchCode;
    }

    public void setBranchCode(String branchCode) {
        this.branchCode = branchCode;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public Long getTeamId() {
        return teamId;
    }

    public void setTeamId(Long teamId) {
        this.teamId = teamId;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public Long getTeamFounderId() {
        return teamFounderId;
    }

    public void setTeamFounderId(Long teamFounderId) {
        this.teamFounderId = teamFounderId;
    }

    public String getFounderNo() {
        return founderNo;
    }

    public void setFounderNo(String founderNo) {
        this.founderNo = founderNo;
    }

    public String getFounderName() {
        return founderName;
    }

    public void setFounderName(String founderName) {
        this.founderName = founderName;
    }

    public BigDecimal getBrokerFyc() {
        return brokerFyc;
    }

    public void setBrokerFyc(BigDecimal brokerFyc) {
        this.brokerFyc = brokerFyc;
    }

    public BigDecimal getDepartmentFee() {
        return departmentFee;
    }

    public void setDepartmentFee(BigDecimal departmentFee) {
        this.departmentFee = departmentFee;
    }

    public BigDecimal getBranchOfficeFee() {
        return branchOfficeFee;
    }

    public void setBranchOfficeFee(BigDecimal branchOfficeFee) {
        this.branchOfficeFee = branchOfficeFee;
    }

    public BigDecimal getHeadOfficeFee() {
        return headOfficeFee;
    }

    public void setHeadOfficeFee(BigDecimal headOfficeFee) {
        this.headOfficeFee = headOfficeFee;
    }

    public Byte getSpecialType() {
        return specialType;
    }

    public void setSpecialType(Byte specialType) {
        this.specialType = specialType;
    }

    public String getFixedAgentCode() {
        return fixedAgentCode;
    }

    public void setFixedAgentCode(String fixedAgentCode) {
        this.fixedAgentCode = fixedAgentCode;
    }

    public String getFixedAgentName() {
        return fixedAgentName;
    }

    public void setFixedAgentName(String fixedAgentName) {
        this.fixedAgentName = fixedAgentName;
    }

    public BigDecimal getFixedMoney() {
        return fixedMoney;
    }

    public void setFixedMoney(BigDecimal fixedMoney) {
        this.fixedMoney = fixedMoney;
    }

    public String getAddChannelCode() {
        return addChannelCode;
    }

    public void setAddChannelCode(String addChannelCode) {
        this.addChannelCode = addChannelCode;
    }

    public String getAddChannelName() {
        return addChannelName;
    }

    public void setAddChannelName(String addChannelName) {
        this.addChannelName = addChannelName;
    }

    public String getReferrerCode() {
        return referrerCode;
    }

    public void setReferrerCode(String referrerCode) {
        this.referrerCode = referrerCode;
    }

    public String getReferrerName() {
        return referrerName;
    }

    public void setReferrerName(String referrerName) {
        this.referrerName = referrerName;
    }

    public String getReferrerPhone() {
        return referrerPhone;
    }

    public void setReferrerPhone(String referrerPhone) {
        this.referrerPhone = referrerPhone;
    }

    public String getReferrerBranchCode() {
        return referrerBranchCode;
    }

    public void setReferrerBranchCode(String referrerBranchCode) {
        this.referrerBranchCode = referrerBranchCode;
    }

    public String getReferrerBranchName() {
        return referrerBranchName;
    }

    public void setReferrerBranchName(String referrerBranchName) {
        this.referrerBranchName = referrerBranchName;
    }

    public String getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(String sendStatus) {
        this.sendStatus = sendStatus;
    }

    public String getPushStatus() {
        return pushStatus;
    }

    public void setPushStatus(String pushStatus) {
        this.pushStatus = pushStatus;
    }

    public String getYgSettStatus() {
        return ygSettStatus;
    }

    public void setYgSettStatus(String ygSettStatus) {
        this.ygSettStatus = ygSettStatus;
    }

    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Byte getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Byte isDeleted) {
        this.isDeleted = isDeleted;
    }
}
